package com.workManager.service;

import com.github.pagehelper.PageInfo;
import com.workManager.pojo.TbProject;
import com.workManager.pojo.TbProjectPayment;
import com.workManager.vo.ProjectPaymentVo;
import com.workManager.vo.ProjectVo;
import org.springframework.dao.DuplicateKeyException;

import java.util.List;
import java.util.Map;

/**
 * Created by Thinkpad on 2017/1/16 0016.
 */
public interface ProjectService {

   TbProject selectByProjectName(String projectName);

   TbProject selectByProjectCode(String projectCode);

   int add(TbProject project) throws DuplicateKeyException;

   int deleteByProjectIds(String[] projectIds);

   int update(TbProject project);

   PageInfo<ProjectVo> query(Map<String,Object> map);

   PageInfo<TbProject> queryByProjectStatus(Map<String,Object> map);

   int insertPayment(TbProjectPayment projectPayment);

   int updatePayment(TbProjectPayment projectPayment);

   int deletePayment(TbProjectPayment projectPayment);

   int delete(List<Integer> idList);

   int updatePaymentRatio(List<Integer> idList,String ratio);

  // List<TbProjectPayment> queryPayment(Map map);

   PageInfo<ProjectPaymentVo> queryPayment(Map map);

   TbProjectPayment queryPaymentById(Integer id);

   List<TbProject> getAllProjects();

   Map<String, Integer> getNameAndIdMapByProjects(List<TbProject> projectList);

   Map<String, Integer> getCodeAndIdMapByProjects(List<TbProject> projectList);

   List<String> getProjectCodeList(List<TbProject> projectList);

   ProjectVo queryByCodeName(Map<String,Object> map);
}
